﻿using Abp.Application.Services.Dto;
using System.Collections.Generic;

namespace shenghua.Member.Members.Dto
{
    public class UpdateMemberDto: EntityDto<long>
    {
        public string UserName { get; set; }
        public string Name { get; set; }
        public bool ResetPassword { get; set; }
        public string Password { get; set; }
        public string PhoneNumber { get; set; }
        public string EmailAddress { get; set; }

        public string Head { get; set; }
        public int Level { get; set; }
        public List<string> Groups { get; set; }
        public string Remark { get; set; }
        public MemberStatus Status { get; set; }

        public UpdateMemberDto()
        {
            Groups = new List<string>();
        }

        public void MapTo(Member member)
        {
            member.UserName = UserName;
            member.Name = Name;
            member.PhoneNumber = PhoneNumber;
            member.EmailAddress = EmailAddress;

            member.Head = Head;
            member.Level = Level;
            member.Groups = new Common.CustomValueType.ValueArray<string>(Groups);
            member.Remark = Remark;
            member.Status = Status;
        }
    }
}